<?php

namespace VueRender\Schema;

use VueRender\Schema;

class Button extends Schema
{
    public function __construct(string $text)
    {
        $this->componentName = "el-button";
        $this->children($text);
    }

    /**
     * @param string $type
     * @return $this
     */
    public function type(string $type):static
    {
        return $this->prop("type",$type);
    }

    /**
     * @param string $name
     * @param string $callback
     * @return $this
     */
    public function onClick(string $name, string $callback): static
    {
        return $this->event("@click",$name, $callback);
    }
}
